package com.itheima.config;


import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConditionalOnClass({OSS.class, OSSClientBuilder.class})
@EnableConfigurationProperties(OSSProperties.class)
public class OSSAutoConfiguration {


    @Bean
    public OssTemplate ossTemplate(OSSProperties ossProperties){
      return  new OssTemplate(ossProperties);
    }
}
